@extends('web.layouts.app')

@section('title', trans('seo.articles.title'))
@section('keywords', trans('seo.articles.keywords'))
@section('description', trans('seo.articles.description'))

@section('styles')
<link rel="stylesheet" type="text/css" href="{{ asset('resources/web/css/information.css')}}">
@endsection

@section('content')
    <div class="information-category">
        <ul>
            @foreach($article_types as $article_type)
                <li {{ $article_type->id==$article_type_id?"class=active":"" }}><a href="{{ action("ArticleController@list",[$article_type->id]) }}">{{$article_type->name}}</a></li>
            @endforeach
        </ul>
    </div>
    <div class="information-wrap clearfix">
        <div class="information-main">
            <div class="information-block-title">文章列表</div>
            <ul class="information-list">
                @foreach($articles as $article)
                    <li>
                        <h2><a href="{{ action("ArticleController@article_information_info",[$article->id])  }}">{{ str_limit($article->title,50) }}</a></h2>
                        <dl class="dl">
                            <dt class="dt"><img src="{{ asset(empty($article->image)?"uploads/article_default.jpg":$article->image,270,150) }}" height="150" width="270"></dt>
                            <dd class="dd">
                                <div class="author"><a class="author" href="#" target="_blank">{{ $article->author }}</a><span>{{ $article->published_at }}</span></div>
                                <p>{{ str_limit($article->description,150) }}<a class="read-all" href="{{ action("ArticleController@article_information_info",[$article->id]) }}">全文 >>></a></p>
                            </dd>
                        </dl>
                        <div class="tips">
                            @foreach(explode(',', $article->tags) as $tag)
                                    <label class="tag" ><a href="{{ action('ArticleController@article_query',['article_type_id'=>$article_type_id,'tag'=>$tag]) }}">{{ $tag }}</a></label>
                                @endforeach
                        </div>
                    </li>
                    @endforeach
            </ul>
            <div class="information-page com-page-bar">
                <ul>

                    {!!$articles->render()!!}
                </ul>
            </div>
        </div>
        <div class="information-side">
            <dl class="information-side-banner">
                <dt>{{ $ad2[0]->name }}</dt>
                <dd><a href="{{ $ad2[0]->link }}"><img src="{{ asset($ad2[0]->image,230,135) }}" height="135" width="230"></a></dd>
            </dl>
            <div class="information-side-list mt20">
                <div class="information-block-title">推荐文章</div>
                <ul>
                    @foreach($recommends as $recommend)
                        <li><a href="{{ action("ArticleController@article_information_info",[$recommend->id]) }}">{{ $recommend->title }}</a></li>
                    @endforeach
                </ul>
            </div>
            <dl class="information-side-banner pt20">
                <dt>{{ $ad1[0]->name }}</dt>
                <dd><a href="{{ $ad1[0]->link }}"><img src="{{ asset($ad1[0]->image,230,90) }}" height="90" width="230"></a></dd>
            </dl>
        </div>
    </div>
@endsection